package com.eschool.beans;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

import com.eschool.beans.datamodels.TeacherDataModel;
import com.eschool.model.Teacher;
import com.eschool.service.TeacherService;
import com.eschool.service.impl.TeacherServiceImpl;

@ManagedBean(name="viewTeachersBean")
@ViewScoped
public class ViewTeacherBean {
	
	private List<Teacher> teachers;
	private Teacher selectedTeacher;
	private TeacherService service;
    private TeacherDataModel model;

	public ViewTeacherBean() {		
		service = new TeacherServiceImpl();
		model = new TeacherDataModel();
		teachers = service.getAllTeachers();
	}
	
	public List<Teacher> getTeachers() {
		return teachers;
	}

	public void setTeachers(List<Teacher> teachers) {
		this.teachers = teachers;
	}	

	public Teacher getSelectedTeacher() {
		return selectedTeacher;
	}

	public void setSelectedTeacher(Teacher selectedTeacher) {
		this.selectedTeacher = selectedTeacher;
	}
	
	public TeacherDataModel getModel() {
		return model;
	}

	public void setModel(TeacherDataModel model) {
		this.model = model;
	}
}
